package com.xyoto.takeawayBusiness.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @Description
 * @Author: TingFeng
 * @CreateTime: 2022/5/4  16:12
 */
@ApiModel("BillDto")
@Data
public class BillDTO {


    @NotNull
    @Min(value = 0,message = "最小值为0")
    private Integer shopId;

    @ApiModelProperty("时间，默认为当天")
    @NotNull
    private String time;

    BillDTO(){
        LocalDateTime now = LocalDateTime.now();
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
        String nowTime = dateTimeFormatter.format(now);
        this.time=nowTime;
    }
}
